#include "SMPPSourcePort.hpp"

using namespace smpp::pdu;

SourcePort::SourcePort(const quint16 nValue):
TLV(TLVtags::TAG_SOURCE_PORT,2),_Value(nValue){}

SourcePort::SourcePort(const SourcePort &nSourcePort):
TLV(nSourcePort),_Value(nSourcePort.getValue()){}

bool SourcePort::operator ==(const SourcePort &nSourcePort) const{
	return (TLV::operator == (nSourcePort) && 
			_Value == nSourcePort.getValue());
}

bool SourcePort::operator !=(const SourcePort &nSourcePort) const{
	return !this->operator == (nSourcePort);
}

SourcePort &SourcePort::operator = (const SourcePort &nSourcePort){
	if(*this == nSourcePort)
		return *this;
	TLV::operator = (nSourcePort);
	_Value = nSourcePort.getValue();
	return *this;
}

void SourcePort::setValue(const quint16 nValue){
	_Value = nValue;
}

const quint16 SourcePort::getValue() const{
	return _Value;
}
